package org.jeecg.modules.demo.baseorderproject.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.demo.baseorderproject.entity.BaseOrderProject;
import org.jeecg.modules.demo.baseorderproject.entity.BaseOrderProjectMain;
import org.jeecg.modules.demo.baseorderproject.entity.BaseOrderProjectWriteoff;
import org.jeecg.modules.demo.baseorderproject.mapper.BaseOrderProjectMapper;
import org.jeecg.modules.demo.baseorderproject.service.IBaseOrderProjectService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Description: 订单核销项目表
 * @Author: jeecg-boot
 * @Date: 2022-02-11
 * @Version: V1.0
 */
@Service
public class BaseOrderProjectServiceImpl extends ServiceImpl<BaseOrderProjectMapper, BaseOrderProject> implements IBaseOrderProjectService {
    @Resource
    private BaseOrderProjectMapper baseOrderProjectMapper;

    // 查询订单核销项目列表
    @Override
    public IPage<BaseOrderProjectWriteoff> searchOrderProjectWriteoff(Page<BaseOrderProjectWriteoff> page, String storeId, String orderCode, String memberName,
                                                                      String memberPhone, String beginTime, String endTime) {
        return baseOrderProjectMapper.searchOrderProjectWriteoff(page, storeId, orderCode, memberName, memberPhone, beginTime, endTime);
    }

    // 查询会员可用项目列表
    @Override
    public List<BaseOrderProjectMain> searchCanUseProjectList(Integer pageNo, Integer pageSize, String storeId, String memberId) {
        return baseOrderProjectMapper.searchCanUseProjectList(pageNo, pageSize, storeId, memberId);
    }

    // 查询会员已用完项目列表
    @Override
    public List<BaseOrderProjectMain> searchHasUsedProjectList(Integer pageNo, Integer pageSize, String storeId, String memberId) {
        return baseOrderProjectMapper.searchCanUseProjectList(pageNo, pageSize, storeId, memberId);
    }
}
